//
//  EditTouristCell.m
//  SXH
//
//  Created by Ryan on 16/3/24.
//  Copyright © 2016年 lyss. All rights reserved.
//

#import "EditTouristCell.h"

@implementation EditTouristCell

- (void)awakeFromNib {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)clickAtSelectBtn:(id)sender
{
    self.model.isSelect = [NSString stringWithFormat:@"%d",![self.model.isSelect boolValue]];
    if ([self.model.isSelect boolValue])
    {
        [self.selectBtn setImage:[UIImage imageNamed:K_selectedImageName] forState:UIControlStateNormal];
    }
    else
    {
        [self.selectBtn setImage:[UIImage imageNamed:K_noSelectedImageName] forState:UIControlStateNormal];
    }
}

- (IBAction)clickAtEditBtn:(id)sender
{
    if ([_delegate respondsToSelector:@selector(gotoEditVC:)]) {
        [_delegate gotoEditVC:self.tag];
    }
}

- (void)setModel:(EditTouristModel *)model
{
    _model = model;
    self.nameLabel.text = model.title;
    self.idNumberLabel.text = model.document_num;
    if ([model.isSelect boolValue])
    {
        [self.selectBtn setImage:[UIImage imageNamed:K_selectedImageName] forState:UIControlStateNormal];
    }
    else
    {
        [self.selectBtn setImage:[UIImage imageNamed:K_noSelectedImageName] forState:UIControlStateNormal];
    }
}

@end
